home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 001 / _resizer / !Resizer / !RunImage (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1993-03-02  |  20KB  |  706 lines

  1.  Forward>>Motion Resizer
  2.  Window Resizer - Microsoft Windows style
  3.         Forward>>Motion
  4.         S O F T W A R E
  5.  Nick Jarman Thu,24 Dec 1992
  6. version$="1.12 (02-Mar-93)"
  7.  "Wimp_Initialise",200,&4B534154,"Resizer" 
  8.  ,task_handle%
  9. initialise
  10. finish%=
  11. error
  12.  finish% 
  13. wimp_poll
  14.  finish%
  15.  "Wimp_CloseDown"
  16. still_open(handle%,address%)
  17.  error_occurred%,result%
  18. error_occurred%=
  19. result%=
  20. :error_occurred=
  21.  error_occurred%=
  22.  handle%<>-1 
  23.     address%!&100=handle%
  24. /    
  25.  "Wimp_GetWindowState",,address%+&100
  26. +    
  27.  address%!&120 
  28.  1<<16 
  29.  result%=
  30. =648 
  31.  window_handle%<>
  32. "$    address%!&100=window_handle%
  33. #     other_window_handle%<>-1
  34.     window_handle%=
  35. %-    
  36.  "Wimp_DeleteWindow",,address%!&100
  37.     result%=
  38. =result%
  39. which_area(mouse_x%,mouse_y%,x%,y%)
  40.  area%,width%,height%
  41. area%=-1
  42. 0Ewidth%=old_max_x%-old_min_x%+v_scrollbar_width%+(border_width%*2)
  43. 1Xheight%=old_max_y%-old_min_y%+h_scrollbar_height%+titlebar_height%+(border_width%*2)
  44. area%=-1
  45.  mouse_x%<=x%+corner_size% 
  46.  mouse_y%<=y%+corner_size% 
  47.     area%=6
  48. 7/    
  49.  mouse_y%>=y%+height%-corner_size%-2 
  50.       area%=0
  51. 9        
  52.       area%=7
  53. ;        
  54.  mouse_x%>=x%+width%-corner_size%-2 
  55. ?%    
  56.  mouse_y%<=y%+corner_size% 
  57.       area%=4
  58. A        
  59. B1      
  60.  mouse_y%>=y%+height%-corner_size%-2 
  61.         area%=2
  62.       
  63.         area%=3
  64.       
  65. G        
  66. I%    
  67.  mouse_y%<=y%+corner_size% 
  68.       area%=5
  69. K        
  70.       area%=1
  71. M        
  72. =area%
  73. window_number_from_handle(handle%)
  74.  number%
  75. number%=0
  76.  handle%(number%)<>handle% 
  77.  number%<no_windows%
  78.   number%+=1
  79.  number%=no_windows% 
  80.  number%=-1
  81. =number%
  82. change_value(value%,change%)
  83.  value% 
  84.     border_width%+=change%
  85. bG    
  86.  border_width%<10 
  87.  border_width%>100 
  88.  border_width%-=change%
  89. c)    
  90.  corner_size%<=border_width%-2 
  91. d&      corner_size%=border_width%+2
  92. e:      $(!(prefs_template%+112+(7*32)))=
  93. (corner_size%)
  94. f+      
  95. redraw_icon(prefs_template%!0,7)
  96. g        
  97. h9    $(!(prefs_template%+112+(3*32)))=
  98. (border_width%)
  99. i)    
  100. redraw_icon(prefs_template%!0,3)
  101. j     create_window_pending%=
  102.     corner_size%+=change%
  103. mD    
  104.  corner_size%<20 
  105.  corner_size%>200 
  106.  corner_size%-=change%
  107. n)    
  108.  corner_size%<=border_width%-2 
  109. o&      border_width%=corner_size%-2
  110. p;      $(!(prefs_template%+112+(3*32)))=
  111. (border_width%)
  112. q+      
  113. redraw_icon(prefs_template%!0,3)
  114. r        
  115. s8    $(!(prefs_template%+112+(7*32)))=
  116. (corner_size%)
  117. t)    
  118. redraw_icon(prefs_template%!0,7)
  119. u     create_window_pending%=
  120.     sleep_time%+=change%
  121. x?    
  122.  sleep_time%<4 
  123.  sleep_time%>40 
  124.  sleep_time%-=change%
  125. y8    $(!(prefs_template%+112+(11*32)))=
  126. (sleep_time%)
  127. z*    
  128. redraw_icon(prefs_template%!0,11)
  129. click(address%)
  130.  window%,icon%,buttons%,mouse_x%,mouse_y%,area%
  131. mouse_x%=address%!0
  132. mouse_y%=address%!4
  133. buttons%=address%!8
  134. window%=address%!12
  135. icon%=address%!16
  136.  window% 
  137.  window_handle%
  138. $    address%!&100=window_handle%
  139. /    
  140.  "Wimp_GetWindowState",,address%+&100
  141.       area%=8
  142.         
  143. J      area%=
  144. which_area(mouse_x%,mouse_y%,address%!&104,address%!&108)
  145.         
  146.  buttons% 
  147.       
  148. #        menublock%!60=&07000101
  149. A        
  150.  "Wimp_CreateMenu",,menublock%,mouse_x%-64,mouse_y%
  151.       
  152.         
  153.  area%<>-1 
  154.           drag_type%=area%
  155. *          address%!&100=window_handle%
  156.           address%!&104=1
  157.           address%!&118=0
  158.           address%!&11C=0
  159. !          address%!&120=10000
  160. !          address%!&124=10000
  161. .          
  162.  "Wimp_DragBox",,address%+&100
  163.         
  164.         
  165.  prefs_handle%
  166.  buttons% 
  167.       
  168.         
  169.  icon% 
  170. 5          
  171. change_value(1,4-(8 
  172.  buttons%=1))
  173. 5          
  174. change_value(1,4-(8 
  175.  buttons%=4))
  176. 5          
  177. change_value(2,4-(8 
  178.  buttons%=1))
  179. 5          
  180. change_value(2,4-(8 
  181.  buttons%=4))
  182. 6          
  183. change_value(3,1-(2 
  184.  buttons%=1))
  185. 6          
  186. change_value(3,1-(2 
  187.  buttons%=4))
  188.           
  189. /            address%!&100=prefs_template%!0
  190.              address%!&104=14
  191. 5            
  192.  "Wimp_GetIconState",,address%+&100
  193. M            
  194.  address%!&118 
  195.  1<<21 
  196.  absolute_drag%=
  197.  absolute_drag%=
  198.           
  199. !            
  200. save_preferences
  201. 6            
  202.  "Wimp_CloseWindow",,prefs_template%
  203.           
  204. /            border_width%=old_border_width%
  205. -            corner_size%=old_corner_size%
  206. +            sleep_time%=old_sleep_time%
  207. 1            absolute_drag%=old_absolute_drag%
  208. A            $(!(prefs_template%+112+(3*32)))=
  209. (border_width%)
  210. @            $(!(prefs_template%+112+(7*32)))=
  211. (corner_size%)
  212. @            $(!(prefs_template%+112+(11*32)))=
  213. (sleep_time%)
  214. {            !(prefs_template%+108+(14*32))=(!(prefs_template%+108+(14*32)) 
  215. (1<<21)))) 
  216.  (1+(absolute_drag%=
  217. ))<<21
  218. (            create_window_pending%=
  219. 7            
  220.  "Wimp_DeleteWindow",,prefs_template%
  221. I            
  222.  "Wimp_CreateWindow",,prefs_template%+4 
  223.  prefs_handle%
  224. /            prefs_template%!0=prefs_handle%
  225.           
  226. 6            
  227.  "Wimp_CloseWindow",,prefs_template%
  228.         
  229.       
  230. #        menublock%!60=&07400101
  231. A        
  232.  "Wimp_CreateMenu",,menublock%,mouse_x%-64,mouse_y%
  233.         
  234. close_window(handle%)
  235.  word%, number%
  236. !block%=handle%
  237.  "Wimp_GetWindowState",,block%
  238. /number%=
  239. window_number_from_handle(handle%)
  240.  word%=1 
  241. /  co_ords(number%,word%-1)=block%!(word%*4)
  242.  word%
  243. open%(number%)=
  244.  "Wimp_CloseWindow",,block%
  245. create_backwindow(address%)
  246.  window_handle%<>
  247. "  address%!&100=window_handle%
  248.  "Wimp_DeleteWindow",,address%+&100
  249. &address%!&100=other_window_handle%
  250.  "Wimp_GetWindowState",,address%+&100
  251.  address%!&120 
  252.  1<<29 
  253.   old_min_x%=address%!&104
  254.   old_min_y%=address%!&108
  255.   old_max_x%=address%!&10C
  256.   old_max_y%=address%!&110
  257.   old_on_top%=address%!&11C
  258. "  old_highlight%=address%!&120
  259. /  template%!4=(address%!&104)-border_width%
  260. /  template%!8=(address%!&108)-border_width%
  261. 0  template%!12=(address%!&10C)+border_width%
  262. 0  template%!16=(address%!&110)+border_width%
  263.   titlebar_height%=0
  264.   v_scrollbar_width%=0
  265.   h_scrollbar_height%=0
  266.  address%!&120 
  267.  1<<20 
  268.  template%?39=12 
  269.  template%?39=2
  270.  address%!&120 
  271.  1<<31 
  272. F    
  273.  address%!&120 
  274.  1<<26 
  275.  template%!16+=40:titlebar_height%=40
  276. H    
  277.  address%!&120 
  278.  1<<28 
  279.  template%!12+=40:v_scrollbar_width%=40
  280. H    
  281.  address%!&120 
  282.  1<<30 
  283.  template%!8-=40:h_scrollbar_height%=40
  284. E    
  285.  address%!&120 
  286.  1<<0 
  287.  template%!16+=40:titlebar_height%=40
  288. G    
  289.  address%!&120 
  290.  1<<2 
  291.  template%!12+=40:v_scrollbar_width%=40
  292. G    
  293.  address%!&120 
  294.  1<<3 
  295.  template%!8-=40:h_scrollbar_height%=40
  296. %  width%=template%!12-template%!4
  297. &  height%=template%!16-template%!8
  298.   template%!44=0
  299.   template%!48=0
  300.   template%!52=width%
  301.   template%!56=height%
  302.    template%!28=address%!&100
  303.  "Wimp_CreateWindow",,template%+4 
  304.  window_handle%
  305.    template%!0=window_handle%
  306.  "Wimp_OpenWindow",,template%
  307.   other_window_handle%=-1
  308.   window_handle%=
  309. error
  310.  result%
  311. =648 
  312.   other_window_handle%=-1
  313.  window_handle%<>
  314.     block%!0=window_handle%
  315.     window_handle%=
  316. %    
  317.  "Wimp_CloseWindow",,block%
  318. &    
  319.  "Wimp_DeleteWindow",,block%
  320.   MODE78:CLS:REPORT:PRINT ERR:PRINTERL:SYS "Wimp_ForceRedraw",-1,0,0,10000,10000:IF GET OSCLI("Print adfs::cathedra.$.!Boot.resources.palette"):OSCLI("POINTER"):END
  321.   block%!&100=
  322. S  $(block%+&104)=
  323. $+" - click Cancel to quit or OK to attempt to continue"+
  324.  "Wimp_ReportError",block%+&100,%11,"Forward>>Motion Resizer" 
  325.  ,result%
  326.  result%=2 
  327.  finish%=
  328. initialise
  329. template_size%=900
  330. indirect_size%=600
  331. no_windows%=1
  332. drag_type%=-1
  333. keysreleased%=
  334. shape$="ptr_default"
  335. last_polled%=
  336.  template% template_size%, indirect% indirect_size%, block% &800, menublock% &100,info_template% template_size%, prefs_template% template_size%
  337. )*indirect_end%=indirect%+indirect_size%
  338. window_handle%=
  339. other_window_handle%=-1
  340. last_area%=-1
  341. create_window_pending%=
  342. read_preferences
  343. load_sprites
  344.  "Wimp_OpenTemplate",,"<Resizer$Dir>.Templates"
  345.  "Wimp_LoadTemplate",,template%+4,indirect%,indirect_end%,-1,"BackWindow" 
  346.  ,,info_indirect%
  347.  "Wimp_LoadTemplate",,info_template%,info_indirect%,indirect_end%,-1,"Info" 
  348.  ,,prefs_indirect%
  349. 3.$(!(info_template%+88+20+(7*32)))=version$
  350.  "Wimp_CreateWindow",,info_template% 
  351.  info_handle%
  352.  "Wimp_LoadTemplate",,prefs_template%+4,prefs_indirect%,indirect_end%,-1,"Preferences"
  353. prefs_template%!68=sprites%
  354. 75$(!(prefs_template%+112+(3*32)))=
  355. (border_width%)
  356. 84$(!(prefs_template%+112+(7*32)))=
  357. (corner_size%)
  358. 94$(!(prefs_template%+112+(11*32)))=
  359. (sleep_time%)
  360. :o!(prefs_template%+108+(14*32))=(!(prefs_template%+108+(14*32)) 
  361. (1<<21)))) 
  362.  (1+(absolute_drag%=
  363. ))<<21
  364.  "Wimp_CreateWindow",,prefs_template%+4 
  365.  prefs_handle%
  366. <#prefs_template%!0=prefs_handle%
  367.  "Wimp_CloseTemplate"
  368. $menublock%="Resizer"
  369. menublock%?12=7
  370. menublock%?13=2
  371. menublock%?14=7
  372. menublock%?15=0
  373. C)menublock%!16=
  374. "Preferences..."*16+12
  375. menublock%!20=44
  376. menublock%!24=0
  377. menublock%!28=0
  378. menublock%!32=info_handle%
  379. menublock%!36=&07000001
  380. $(menublock%+40)="Info"
  381. menublock%!52=0
  382. menublock%!56=-1
  383. menublock%!60=&07000101
  384. M menublock%!64=menublock%+100
  385. menublock%!68=-1
  386. menublock%!72=0
  387. menublock%!76=1<<7
  388. menublock%!80=-1
  389. menublock%!84=&07000001
  390. $(menublock%+88)="Quit"
  391. T&$(menublock%+100)="Preferences..."
  392. load_sprites
  393.  file%
  394. [$file%=
  395. ("<Resizer$Dir>.Sprites")
  396.  sprites% 
  397. #file%+&10
  398. sprites%!0=
  399. #file%+&10
  400. sprites%!4=0
  401. sprites%!8=16
  402. sprites%!12=16
  403.  #file%
  404.  "OS_SpriteOp",&20A,sprites%,"<Resizer$Dir>.Sprites"
  405. message
  406.  address%!16=0 
  407.  finish%=
  408. menu_select(address%)
  409.  reopen%,width%,height%
  410. reopen%=
  411.  "Wimp_GetPointerInfo",,address%+&100
  412.  address%!&108=1 
  413.  reopen%=
  414.  address%!0 
  415. t%    old_corner_size%=corner_size%
  416. u'    old_border_width%=border_width%
  417. v#    old_sleep_time%=sleep_time%
  418. w)    old_absolute_drag%=absolute_drag%
  419. x3    width%=prefs_template%!12-prefs_template%!4
  420. y4    height%=prefs_template%!16-prefs_template%!8
  421. z0    prefs_template%!4=address%!&100-width%/2
  422. {1    prefs_template%!8=address%!&104-height%/2
  423. |3    prefs_template%!12=prefs_template%!4+width%
  424. }4    prefs_template%!16=prefs_template%!8+height%
  425.     prefs_template%!28=-1
  426. -    
  427.  "Wimp_OpenWindow",,prefs_template%
  428.  2:finish%=
  429.  reopen% 
  430.  "Wimp_CreateMenu",,menublock%
  431. move_icon(no%,xpos%,ypos%,width%,height%)
  432.  address%
  433. "address%=template%+92+(no%*32)
  434. address%!0=xpos%
  435. address%!4=ypos%
  436. address%!8=xpos%+width%
  437. address%!12=ypos%+height%
  438.  width%,height%,pointer_window_handle%,area%
  439.  create_window_pending%=
  440.  window_handle%<>
  441. create_backwindow(block%)
  442.   create_window_pending%=
  443.  window_handle%<>
  444.  "Wimp_GetPointerInfo",,block%
  445.  block%!12=window_handle% 
  446. "    block%!&100=window_handle%
  447. -    
  448.  "Wimp_GetWindowState",,block%+&100
  449. D    area%=
  450. which_area(block%!0,block%!4,block%!&104,block%!&108)
  451.  area%<>last_area% 
  452.       
  453.  area% 
  454.         
  455. 2          
  456. set_pointer_shape("ptr_tlbr",12,12)
  457.         
  458. /          
  459. set_pointer_shape("ptr_tb",9,17)
  460.         
  461. 2          
  462. set_pointer_shape("ptr_trbl",12,12)
  463.         
  464. 0          
  465. set_pointer_shape("ptr_lr",16,10)
  466.         
  467. 3          
  468. set_pointer_shape("ptr_default",0,0)
  469.       
  470.         
  471.     last_area%=area%
  472. @    
  473.  last_area%<>-1 
  474. set_pointer_shape("ptr_default",0,0)
  475.     last_area%=-1
  476.  other_window_handle%<>-1 
  477. #  block%!0=other_window_handle%
  478.  "Wimp_GetWindowState",,block%
  479.  old_min_x%<>block%!4 
  480.  old_min_y%<>block%!8 
  481.  old_max_x%<>block%!12 
  482.  old_max_y%<>block%!16 
  483.  old_on_top%<>block%!28 
  484.  old_highlight%<>block%!32 
  485. "    
  486. create_backwindow(block%)
  487. !    
  488.  (block%!32 
  489.  1<<16)=0 
  490. !      block%!0=window_handle%
  491. (      
  492.  "Wimp_DeleteWindow",,block%
  493.       window_handle%=
  494. !      other_window_handle%=-1
  495.         
  496.  keysreleased%=
  497.  "Wimp_GetPointerInfo",,block%+&80
  498. '  pointer_window_handle%=block%!&8C
  499.  window_handle%=
  500.  keysreleased% 
  501. 5      other_window_handle%=pointer_window_handle%
  502. $      
  503. create_backwindow(block%)
  504.       keysreleased%=
  505.         
  506. 7    
  507. -9)) 
  508.  keysreleased% 
  509. a      
  510.  pointer_window_handle%=other_window_handle% 
  511.  pointer_window_handle%=window_handle% 
  512. &        block%!&100=window_handle%
  513. .        
  514.  "Wimp_CloseWindow",,block%+&100
  515. /        
  516.  "Wimp_DeleteWindow",,block%+&100
  517.         window_handle%=
  518. #        other_window_handle%=-1
  519. !        
  520.  "Wimp_DragBox",,-1
  521.         drag_type%=-1
  522.       
  523. 7        other_window_handle%=pointer_window_handle%
  524. &        
  525. create_backwindow(block%)
  526.       
  527.       keysreleased%=
  528.         
  529. open_window(address%)
  530.  address%!0=window_handle% 
  531. open_window_border(address%)
  532.  "Wimp_OpenWindow",,address%
  533. open_window_border(address%)
  534.  on_top%
  535. on_top%=
  536.  drag_type%=-1 
  537.  "Wimp_OpenWindow",,address%
  538.  "Wimp_GetPointerInfo",,address%+&100
  539.  address%!&108=%100 
  540.  on_top%=
  541. (  address%!&100=other_window_handle%
  542.  "Wimp_GetWindowState",,address%+&100
  543.  on_top% 
  544.  address%!&11C=-1
  545.  drag_type% 
  546. 1      address%!&104=address%!&4+border_width%
  547. C      address%!&110=address%!&10-border_width%-titlebar_height%
  548.       
  549.  absolute_drag% 
  550. B        address%!&118=address%!&118+(address%!&110-old_max_y%)
  551. B        address%!&114=address%!&114-(old_min_x%-address%!&104)
  552.       
  553. C      address%!&110=address%!&10-border_width%-titlebar_height%
  554. S      
  555.  absolute_drag% 
  556.  address%!&118=address%!&118+(address%!&110-old_max_y%)
  557. D      address%!&10C=address%!&C-border_width%-v_scrollbar_width%
  558. C      address%!&110=address%!&10-border_width%-titlebar_height%
  559. S      
  560.  absolute_drag% 
  561.  address%!&118=address%!&118+(address%!&110-old_max_y%)
  562. D      address%!&10C=address%!&C-border_width%-v_scrollbar_width%
  563. U      
  564.  absolute_drag% 
  565.  address%!&114=address%!&114+(old_max_x%-address%!&10C)
  566. E      address%!&108=address%!&8+border_width%+h_scrollbar_height%
  567.     D      address%!&10C=address%!&C-border_width%-v_scrollbar_width%
  568.       
  569.  absolute_drag% 
  570. B        address%!&114=address%!&114+(old_max_x%-address%!&10C)
  571. B        address%!&118=address%!&118-(address%!&108-old_min_y%)
  572.       
  573. E      address%!&108=address%!&8+border_width%+h_scrollbar_height%
  574.       
  575.  absolute_drag% 
  576. B        address%!&114=address%!&114+(old_max_x%-address%!&10C)
  577. B        address%!&118=address%!&118-(address%!&108-old_min_y%)
  578.       
  579. 1      address%!&104=address%!&4+border_width%
  580. E      address%!&108=address%!&8+border_width%+h_scrollbar_height%
  581.       
  582.  absolute_drag% 
  583. B        address%!&114=address%!&114-(old_min_x%-address%!&104)
  584.       
  585. B        address%!&118=address%!&118-(address%!&108-old_min_y%)
  586.       
  587. 1      address%!&104=address%!&4+border_width%
  588. S      
  589.  absolute_drag% 
  590.  address%!&114=address%!&114-(old_min_x%-address%!&104)
  591.  0      address%!&104=address%!4+border_width%
  592. !D      address%!&108=address%!8+border_width%+h_scrollbar_height%
  593. "D      address%!&10C=address%!&C-border_width%-v_scrollbar_width%
  594. #C      address%!&110=address%!&10-border_width%-titlebar_height%
  595. $+      
  596. create_backwindow(address%+&100)
  597.  "Wimp_SendMessage",2,address%+&100,other_window_handle%
  598.  address%!&104<>old_min_x% 
  599.  address%!&108<>old_min_y% 
  600.  address%!&10C<>old_max_x% 
  601.  address%!&110<>old_max_y% 
  602.  address%!&11C<>old_on_top% 
  603.  address%!&120<>old_highlight% 
  604. create_backwindow(address%+&100)
  605. read_preferences
  606.  file%,abs$
  607. /'file%=
  608. ("<Resizer$Dir>.Preference")
  609.  file%<>0 
  610. #file%,border_width%
  611. #file%,corner_size%
  612. #file%,sleep_time%
  613. #file%,abs$
  614.  abs$="Y" absolute_drag%=
  615.  absolute_drag%=
  616. #file%
  617.   border_width%=20
  618.   corner_size%=70
  619.   sleep_time%=7
  620.   absolute_drag%=
  621. rectangle(x%,y%,width%,height%)
  622.  "Wimp_SetColour",4
  623.  x%,y%,x%+width%,y%
  624.  x%+width%,y%+height%
  625.  x%+2,y%+2,x%+width%-2,y%+2
  626.  x%+width%-2,y%+height%-2
  627.  "Wimp_SetColour",0
  628.  x%,y%+2,x%,y%+height%
  629.  x%+width%-2,y%+height%
  630.  x%+2,y%+4,x%+2,y%+height%-2
  631.  x%+width%-4,y%+height%-2
  632. redraw_icon(window%,icon%)
  633. address%!&100=window%
  634. address%!&104=icon%
  635.  "Wimp_GetIconState",,address%+&100
  636.  "Wimp_ForceRedraw",window%,address%!&108,address%!&10C,address%!&110,address%!&114
  637. redraw_window(address%)
  638.  more_rectangles%,width%,height%,x%,y%
  639. [&address%!&100=other_window_handle%
  640.  "Wimp_GetWindowState",,address%+&100
  641.  address%!&104<>old_min_x% 
  642.  address%!&108<>old_min_y% 
  643.  address%!&10C<>old_max_x% 
  644.  address%!&110<>old_max_y% 
  645.  address%!&11C<>old_on_top% 
  646.  address%!&120<>old_highlight% 
  647. create_backwindow(address%+&100)
  648. ^Ewidth%=old_max_x%-old_min_x%+v_scrollbar_width%+(border_width%*2)
  649. _Xheight%=old_max_y%-old_min_y%+h_scrollbar_height%+titlebar_height%+(border_width%*2)
  650.  address%!0=window_handle% 
  651.  "Wimp_RedrawWindow",,address% 
  652.  more_rectangles%
  653.  more_rectangles%
  654.     x%=block%!4
  655.     y%=block%!8
  656. e3    
  657. rectangle(x%,y%,corner_size%,corner_size%)
  658. fI    
  659. rectangle(x%+width%-corner_size%-2,y%,corner_size%,corner_size%)
  660. g`    
  661. rectangle(x%+width%-corner_size%-2,y%+height%-corner_size%-2,corner_size%,corner_size%)
  662. hJ    
  663. rectangle(x%,y%+height%-corner_size%-2,corner_size%,corner_size%)
  664. iO    
  665. rectangle(x%+corner_size%+2,y%,width%-(corner_size%*2)-6,corner_size%)
  666. jf    
  667. rectangle(x%+corner_size%+2,y%+height%-corner_size%-2,width%-(corner_size%*2)-6,corner_size%)
  668. kP    
  669. rectangle(x%,y%+corner_size%+2,corner_size%,height%-(corner_size%*2)-6)
  670. lf    
  671. rectangle(x%+width%-corner_size%-2,y%+corner_size%+2,corner_size%,height%-(corner_size%*2)-6)
  672. m;    
  673.  "Wimp_GetRectangle",,address% 
  674.  more_rectangles%
  675. save_preferences
  676.  file%,abs$
  677. v'file%=
  678. ("<Resizer$Dir>.Preference")
  679.  file%<>0 
  680. #file%,border_width%
  681. #file%,corner_size%
  682. #file%,sleep_time%
  683.  absolute_drag% 
  684.  abs$="Y" 
  685.  abs$="N"
  686. #file%,abs$
  687. #file%
  688.  42,"Could not write to Preferences file"
  689. set_pointer_shape(name$,x%,y%)
  690.  "Wimp_SpriteOp",36,,name$,%100001,x%,y%,0
  691. shape$=name$
  692. wimp_poll
  693.  "Wimp_PollIdle",0,block%,
  694. +sleep_time% 
  695.  reason%,address%
  696.  reason% 
  697. redraw_window(address%)
  698. open_window(address%)
  699. close_window(!address%)
  700. set_pointer_shape("ptr_default",0,0):last_area%=-1
  701. click(address%)
  702.  7:drag_type%=
  703. menu_select(address%)
  704.  17,18:
  705. message
  706.